package cn.qiguai.sphapi.config;

import cn.qiguai.sphapi.interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new JWTInterceptor())
				//拦截路径
				.addPathPatterns(
						"/api/user/addToShoppingCart",
						"/api/user/getPageShoppingCartOrder",
						"/api/user/selectOneShoppingCartOrder",
						"/api/user/selectAllShoppingCartOrder",
						"/api/user/removeOrder",
						"/api/user/getAddresseeInfo");
	}
}
